<!DOCTYPE html>
<html>
<head>
    <title>平台管理</title>
    <#include "/header.html">
    <link
            href="${request.contextPath}/statics/plugins/jquery-layout/jquery.layout-latest.css"
            rel="stylesheet" />
    <script src="${request.contextPath}/statics/plugins/layui/layui.all.js"></script>
    <style>
        .bootstrap-select{
            width: 100% !important;
        }
        .glyphicon-arrow-up{
            color: red;
        }

        .glyphicon-arrow-down{
            color: #76d471;
        }
        #tableData{
            margin: 20px 0;
        }
        #tableData tr td,th{
            text-align: center;
            white-space: nowrap;
        }

    </style>
</head>
<body>


<div id="rrapp" v-cloak class="container-div ui-layout-center">
    <div class="layui-container" style="width: 100%;">
        <div class="layui-row" style="margin-top: 10px;">
           <div class="layui-col-md3">
                <a class="btn btn-warning" onclick="history.go(-1)">返回</a>
              </div>
       </div>
    </div>
       <div class="col-sm-12 select-info table-striped">
           <table class="table table-bordered table-hover" id="tableData" >
               <!--<tr>-->
               <!--<th>类型[item]</th>-->
               <!--<th>有银子</th>-->
               <!--<th>趣转发</th>-->
               <!--</tr>-->
               <!--<tr>-->
               <!--<td>转发人数[param]</td>-->
               <!--<td>1[value]</td>-->
               <!--<td>2</td>-->
               <!--</tr>-->
               <!--<tr>-->
               <!--<td>转发人数[param]</td>-->
               <!--<td>1[value]</td>-->
               <!--<td>2</td>-->
               <!--</tr>-->
           </table>
        </div>
    </div>
</div>


<script
        src="${request.contextPath}/statics/plugins/jquery-layout/jquery.layout-latest.js"></script>


<!-- <script src="${request.contextPath}/statics/js/modules/sys/user.js?_${.now?long}"></script>
-->
<script>


    $(document)
        .ready(
            function() {
                $('body').layout({
                    west__size : 185
                });
                function getQueryString(name) {
                    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                    var r = window.location.search.substr(1).match(reg);
                    if (r != null) return unescape(r[2]);
                    return null;
                }
                //console.log(getQueryString('id'))
                if(getQueryString('id')){
                    domainDetailsPage.init(getQueryString('id'));
                }

            });
var domainDetailsPage = {
    init:function (id) {
        this.getData(id);
    },
   getData:function (id) {
       var  indexLoading = layer.load(2);
       var _this = this;
       var params = {
           id:id
       };
        $.ajax({
            type : "POST",
            url : baseURL + 'domaincate/findPlatformAlarmNumListById',
            contentType : "application/json",
            data : JSON.stringify(params),
            dataType:'json',
            success : function(r) {
                $("#search").attr("disabled",false);
                if (r.code === 0) {
                    _this.showTable(r.result);
                    layer.close(indexLoading);
                } else {
                    alert(r.msg);
                }
            }
        });
    },
    showTable:function (res) {
        var taHead = '<thead><tr><th>平台名称</th><th>域名库存报警警戒值</th></tr></thead>';
        var taBody = '';
        for(var i=0;i<res.length;i++){
            taBody = taBody + '<tr><th>'+res[i].platformNickName+'</th><th>'+res[i].alarmNum+'</th></tr>';
        }
        var str = taHead + '<tbody>' + taBody + '</tbody>';
        $("#tableData").html(str);
    }
}
</script>


</body>
</html>